UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LU9dGs39r8yWXAJOYXh7D3RqiBCdxWkmJEWYfvi8LLY='
WHERE
key_id = '636ce089504378153dda8f3beffed571eaac4e337ef6dbf09835030790a7a01e'
AND (
token = 'LU9dGs39r8yWXAJOYXh7D3RqiBCdxWkmJEWYfvi8LLY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)