UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7tCORVwpPAGwPBGt0lj2I6dnGQTIZTfMh48sf58USUc='
WHERE
key_id = '5aeb6cd4f7aa2797170a6820f38fcfba3c7dc82fd1c58a383acda3bc44e5c402'
AND (
token = '7tCORVwpPAGwPBGt0lj2I6dnGQTIZTfMh48sf58USUc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)