UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XeLElgeS8ddi29hS0vxL0tlArhwLnyrzGD5dcNPqsfc='
WHERE
key_id = 'ccadec6f5830170eeff10483290e6638eeb7a5c4b66c8a66140613325b6062e1'
AND (
token = 'XeLElgeS8ddi29hS0vxL0tlArhwLnyrzGD5dcNPqsfc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)