UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MopoiPlHfErJzKMF7lhALO4zxGrjouLH4qbs9Zuerhs='
WHERE
key_id = '3d8e33004c5d4bf99819cdbbccfcc44b611389a607d77d16e16543289b35f3ba'
AND (
token = 'MopoiPlHfErJzKMF7lhALO4zxGrjouLH4qbs9Zuerhs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)