UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HZyO738mqqARAHpMtDx58gOK8ZkJ+QzqJtnOezqztvY='
WHERE
key_id = '544027351c44a5bee39c449fddbedf12cf1c6b8898a0a4cac07e4bf644d90203'
AND (
token = 'HZyO738mqqARAHpMtDx58gOK8ZkJ+QzqJtnOezqztvY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)