UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'f2mHWydTtqEzm3/XBoIHlH4+etugUdKWPBQfVM9ZKe4='
WHERE
key_id = '4cffd40d490b0e29cd54c7d0f19df09d5dfe38da4d2fb8940aa086c14625a0d4'
AND (
token = 'f2mHWydTtqEzm3/XBoIHlH4+etugUdKWPBQfVM9ZKe4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)