UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TLtcHMSW/+c1fTc+0XJ2ge9xXiNCsTWVbil1rQvSCBI=' 
WHERE 
  key_id = '96b7c752e79b6ea55ee61d2e727697e82e59dea8d7a65bfc30ba5eb31c0057cc' 
  AND (
    token = 'TLtcHMSW/+c1fTc+0XJ2ge9xXiNCsTWVbil1rQvSCBI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042