UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3g6ld00pRGTlZlM0CbRdlRHXxbF9R/+M1phARRspOlc='
WHERE
key_id = '1d2f743ca4cfebad381c42cf04178cd0cb94d509ec9854abc937a1f055eacdba'
AND (
token = '3g6ld00pRGTlZlM0CbRdlRHXxbF9R/+M1phARRspOlc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)