UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M2VVsXKiiFiaHBGQZXYastKQf4Z3JDceXSwLqZj1RVs='
WHERE
key_id = '27f0d6c9ea8c41a9aced3cb639dd0178feef70e9f3f7b6bf436040e650ec58d7'
AND (
token = 'M2VVsXKiiFiaHBGQZXYastKQf4Z3JDceXSwLqZj1RVs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)