UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MeD71dTLaGgFFmEF/NrH8fjQRSMcEBaICoCpUP3ZadM='
WHERE
key_id = '7d14dd15884f4722aaafddeb56901cd8f5904ae0e204defde6f3bd675f755780'
AND (
token = 'MeD71dTLaGgFFmEF/NrH8fjQRSMcEBaICoCpUP3ZadM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)