UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dUavdR/3JYEscuM4DfhQLhQCfc8WtVmXKh75GBRj4Ac='
WHERE
key_id = 'a6f88cbf7058c45f936e8aa89bf8b1930f0df5a613fd954de8a267de6f0b3c20'
AND (
token = 'dUavdR/3JYEscuM4DfhQLhQCfc8WtVmXKh75GBRj4Ac='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)