UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oGe4uLu0gLQYbCCEvOgmtYj/nMFGedTo5u+bMmJY8tI='
WHERE
key_id = '182a8bc170f20e7f545694a14968500c467ea4b0e28e1f2372f92c0eb84ba879'
AND (
token = 'oGe4uLu0gLQYbCCEvOgmtYj/nMFGedTo5u+bMmJY8tI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)