UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4P/EGEszUVFNM+B9e7PhNiPT8C4SkHw37oNdaGcfRTg='
WHERE
key_id = 'f77f40e63516c157e2196ae1914c5722dfdf43e15c0700a6dd89a2bc3f5ae11a'
AND (
token = '4P/EGEszUVFNM+B9e7PhNiPT8C4SkHw37oNdaGcfRTg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)